package it.univaq.mwt.backoffice.form;

import org.apache.struts.validator.ValidatorForm;

public class UserForm extends ValidatorForm {

	private static final long serialVersionUID = 1L;
	    
	private String name;
	private String username;
	private String password;
	private String email;

	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public static long getSerialVersionUID() {
		return serialVersionUID;
	}
//    public void reset(ActionMapping mapping, HttpServletRequest request) {
//        
//    	this.name=null;
//        this.username=null;
//    	this.email=null;
//        this.password=null;
//        }
//
//        /**
//         * Reset all properties to their default values.
//         *
//         * @param mapping The mapping used to select this instance
//         * @param request The servlet request we are processing
//       * @return errors
//         */
//      public ActionErrors validate( 
//          ActionMapping mapping, HttpServletRequest request ) {
//          ActionErrors errors = new ActionErrors();
//          
//          if( getName() == null || getName().length() < 1 ) {
//            errors.add("name",new ActionMessage("error.name.required"));
//          }
//          if( getUsername() == null || getUsername().length() < 1 ) {
//            errors.add("username",new ActionMessage("error.username.required"));
//          }
//          if( getPassword() == null || getPassword().length() < 1 ) {
//            errors.add("password",new ActionMessage("error.passoword.required"));
//          }
//          if( getEmail() == null || getEmail().length() < 1 ) {
//              errors.add("email",new ActionMessage("error.email.required"));
//            }
//          return errors;
//      }
	
}
